package com.flick.po;

import com.fasterxml.jackson.annotation.JsonIgnore;
import org.hibernate.annotations.GenericGenerator;
import org.springframework.hateoas.core.Relation;

import javax.persistence.*;
import java.util.HashSet;
import java.util.Set;

/**
 * @author flick on 2017/4/27.
 * @version 1.0
 */
@Entity
@Relation(value = "theclass", collectionRelation = "theclasses")
public class Theclass extends AbstractEntity{
    private String name;

    @OneToMany(mappedBy = "theclass", fetch = FetchType.LAZY, orphanRemoval = true)
    @JsonIgnore
    private Set<Student> items = new HashSet<>();

    @Column(name = "name")
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Set<Student> getItems() {
        return items;
    }

    public void setItems(Set<Student> items) {
        this.items = items;
    }
}
